﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class test4 : MonoBehaviour {


	public GameObject g = null;

	// Use this for initialization
	void Start () {
	
//		Handheld.PlayFullScreenMovie ( Application.persistentDataPath + "/03.mp4", Color.black, FullScreenMovieControlMode.CancelOnInput, FullScreenMovieScalingMode.Fill);

		StartCoroutine(PlayStreamingVideo(Application.persistentDataPath + "/03.mp4"));
	}
	
	// Update is called once per frame
	void Update () {
		if (finished) {
		
			Invoke ("test", 3f);
			finished = false;
		}
	}

	void test()
	{
		g.SetActive (true);
	}


	bool finished = false;
	private IEnumerator PlayStreamingVideo(string url)
	{
		Handheld.PlayFullScreenMovie(url, Color.black, FullScreenMovieControlMode.Full, FullScreenMovieScalingMode.AspectFill);
		yield return new WaitForEndOfFrame();
		yield return new WaitForEndOfFrame();

		finished = true;
	}
}
